# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AlloyDB.V1.Model.DenyMaintenancePeriod do
  @moduledoc """
  DenyMaintenancePeriod definition. Excepting emergencies, maintenance will not be scheduled to start within this deny period. The start_date must be less than the end_date.

  ## Attributes

  *   `endDate` (*type:* `GoogleApi.AlloyDB.V1.Model.GoogleTypeDate.t`, *default:* `nil`) - Deny period end date. This can be: * A full date, with non-zero year, month and day values OR * A month and day value, with a zero year for recurring
  *   `startDate` (*type:* `GoogleApi.AlloyDB.V1.Model.GoogleTypeDate.t`, *default:* `nil`) - Deny period start date. This can be: * A full date, with non-zero year, month and day values OR * A month and day value, with a zero year for recurring
  *   `time` (*type:* `GoogleApi.AlloyDB.V1.Model.GoogleTypeTimeOfDay.t`, *default:* `nil`) - Time in UTC when the deny period starts on start_date and ends on end_date. This can be: * Full time OR * All zeros for 00:00:00 UTC
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :endDate => GoogleApi.AlloyDB.V1.Model.GoogleTypeDate.t() | nil,
          :startDate => GoogleApi.AlloyDB.V1.Model.GoogleTypeDate.t() | nil,
          :time => GoogleApi.AlloyDB.V1.Model.GoogleTypeTimeOfDay.t() | nil
        }

  field(:endDate, as: GoogleApi.AlloyDB.V1.Model.GoogleTypeDate)
  field(:startDate, as: GoogleApi.AlloyDB.V1.Model.GoogleTypeDate)
  field(:time, as: GoogleApi.AlloyDB.V1.Model.GoogleTypeTimeOfDay)
end

defimpl Poison.Decoder, for: GoogleApi.AlloyDB.V1.Model.DenyMaintenancePeriod do
  def decode(value, options) do
    GoogleApi.AlloyDB.V1.Model.DenyMaintenancePeriod.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AlloyDB.V1.Model.DenyMaintenancePeriod do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
